﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2013/3/23 星期六 16:58:58
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sector7.Framework.Utility;
using Sector7.Medical.INFS;
using Sector7.Medical.SYSS;
using Sector7.Medical.STOS;
using Sector7.Medical.TRAS;
using Sector7.Medical.BIZS;

namespace Sector7.Medical.Utility
{
    /// <summary>
    /// WCF客户端单例
    /// </summary>
    public class WcfClient
    {
        #region Accessor
        /// <summary>
        /// 获取STOS客户端实例
        /// </summary>
        public static WcfClientUtil<IStockService> STOS
        {
            get
            {
                if (m_stos == null)
                {
                    m_stos = new WcfClientUtil<IStockService>();
                }
                return m_stos;
            }
        }

        /// <summary>
        /// 获取INFS客户端实例
        /// </summary>
        public static WcfClientUtil<IInformationService> INFS
        {
            get
            {
                if (m_infs == null)
                {
                    m_infs = new WcfClientUtil<IInformationService>();
                }
                return m_infs;
            }
        }

        /// <summary>
        /// 获取SYSS客户端实例
        /// </summary>
        public static WcfClientUtil<ISystemService> SYSS
        {
            get
            {
                if (m_syss == null)
                {
                    m_syss = new WcfClientUtil<ISystemService>();
                }
                return m_syss;
            }
        }

        /// <summary>
        /// 获取TRAS客户端实例
        /// </summary>
        public static WcfClientUtil<ITransferService> TRAS
        {
            get
            {
                if (m_tras == null)
                {
                    m_tras = new WcfClientUtil<ITransferService>();
                }
                return m_tras;
            }
        }

        /// <summary>
        /// 获取BIZS客户端实例
        /// </summary>
        public static WcfClientUtil<IBusinessService> BIZS
        {
            get
            {
                if (m_bizs == null)
                {
                    m_bizs = new WcfClientUtil<IBusinessService>();
                }
                return m_bizs;
            }
        }
        #endregion

        #region Public functions
        #endregion

        #region Private functions
        #endregion

        #region Structure
        /// <summary>
        /// 私有构造器
        /// </summary>
        private WcfClient()
        {
        }
        #endregion

        #region Inner members
        private static WcfClientUtil<IStockService> m_stos = null;
        private static WcfClientUtil<IInformationService> m_infs = null;
        private static WcfClientUtil<ISystemService> m_syss = null;
        private static WcfClientUtil<ITransferService> m_tras = null;
        private static WcfClientUtil<IBusinessService> m_bizs = null;
        #endregion
    }
}
